<?php if(!defined("HDPHP_PATH"))exit;C("SHOW_NOTICE",FALSE);?><!DOCTYPE HTML>
<html lang="en-US">
<head>
	<meta charset="UTF-8">
	<title>添加商品类型</title>
	<script type='text/javascript' src='http://127.0.0.1/teacherShop/hdphp/hdphp/Extend/Org/Jquery/jquery-1.8.2.min.js'></script>
<link href='http://127.0.0.1/teacherShop/hdphp/hdphp/../hdjs/css/hdjs.css' rel='stylesheet' media='screen'>
<script src='http://127.0.0.1/teacherShop/hdphp/hdphp/../hdjs/js/hdjs.js'></script>
<script src='http://127.0.0.1/teacherShop/hdphp/hdphp/../hdjs/js/slide.js'></script>
<script src='http://127.0.0.1/teacherShop/hdphp/hdphp/../hdjs/org/cal/lhgcalendar.min.js'></script>
<script type='text/javascript'>
		HOST = 'http://127.0.0.1';
		ROOT = 'http://127.0.0.1/teacherShop';
		WEB = 'http://127.0.0.1/teacherShop/index.php';
		URL = 'http://127.0.0.1/teacherShop/index.php/Admin/Category/save/cid/3/pid/0';
		HDPHP = 'http://127.0.0.1/teacherShop/hdphp/hdphp';
		HDPHPDATA = 'http://127.0.0.1/teacherShop/hdphp/hdphp/Data';
		HDPHPTPL = 'http://127.0.0.1/teacherShop/hdphp/hdphp/Lib/Tpl';
		HDPHPEXTEND = 'http://127.0.0.1/teacherShop/hdphp/hdphp/Extend';
		APP = 'http://127.0.0.1/teacherShop/index.php/Admin';
		CONTROL = 'http://127.0.0.1/teacherShop/index.php/Admin/Category';
		METH = 'http://127.0.0.1/teacherShop/index.php/Admin/Category/save';
		GROUP = 'http://127.0.0.1/teacherShop/my';
		TPL = 'http://127.0.0.1/teacherShop/my/myshop/Admin/Tpl';
		CONTROLTPL = 'http://127.0.0.1/teacherShop/my/myshop/Admin/Tpl/Category';
		STATIC = 'http://127.0.0.1/teacherShop/Static';
		PUBLIC = 'http://127.0.0.1/teacherShop/my/myshop/Admin/Tpl/Public';
		HISTORY = 'http://127.0.0.1/teacherShop/index.php/Admin/Category/index';
		HTTPREFERER = 'http://127.0.0.1/teacherShop/index.php/Admin/Category/index';
</script>
	<script type="text/javascript" src="http://127.0.0.1/teacherShop/my/myshop/Admin/Tpl/Category/Js/field.js"></script>
</head>
<body>
	<div class="menu_list">
		<ul>
			<li><a href="<?php echo U('index');?>">栏目列表</a></li>
			<li><a href="<?php echo U('add');?>"  class="action">添加栏目</a></li>
			<li><a href="<?php echo U('updateCache');?>">更新栏目缓存</a></li>
		</ul>
	</div>

	<form action="" method="post" class=" hd-form">
		<input type="hidden" name="pid" value="<?php echo $data['pid'];?>">
		<div class="title-header">添加栏目</div>
		<table class="table1 hd-form">
			<tr>
				<th class="w100">栏目名</th>
				<td><input type="text" name="cname" value="<?php echo $data['cname'];?>"></td>
			</tr>
			<tr>
				<th class="w100">上级栏目</th>
				<td>
					<select name="pid" id="">
						<option value="">=====顶级栏目=====</option>
						<?php $hd["list"]["c"]["total"]=0;if(isset($catdata) && !empty($catdata)):$_id_c=0;$_index_c=0;$lastc=min(1000,count($catdata));
$hd["list"]["c"]["first"]=true;
$hd["list"]["c"]["last"]=false;
$_total_c=ceil($lastc/1);$hd["list"]["c"]["total"]=$_total_c;
$_data_c = array_slice($catdata,0,$lastc);
if(count($_data_c)==0):echo "";
else:
foreach($_data_c as $key=>$c):
if(($_id_c)%1==0):$_id_c++;else:$_id_c++;continue;endif;
$hd["list"]["c"]["index"]=++$_index_c;
if($_index_c>=$_total_c):$hd["list"]["c"]["last"]=true;endif;?>

							<option value="<?php echo $c['cid'];?>" <?php echo $c['disabled'];?> <?php echo $c['selected'];?>><?php echo $c['_name'];?></option>
					 	<?php $hd["list"]["c"]["first"]=false;
endforeach;
endif;
else:
echo "";
endif;?>
					</select>
				</td>
			</tr>
			<tr>
				<th class="w100">关键字</th>
				<td><input type="text" name="keywords" class="w150" value="<?php echo $data['keywords'];?>"></td>
			</tr>
			<tr>
				<th class="w100">描述</th>
				<td><input type="textarea" name="description" class="w400 h100" value="<?php echo $data['description'];?>"></td>
			</tr>
			<tr>
				<th class="w100">栏目类型</th>
				<td>
					
					<label><input type="radio" name="cattype" <?php if($data['cattype'] == 0){?>checked=""<?php }?> value="0"> 普通栏目</label>
					<label><input type="radio" name="cattype" <?php if($data['cattype'] == 1){?>checked=""<?php }?> value="1"> 封面</label>
					
				</td>
			</tr>
			<tr>
				<th class="w100">单位</th>
				<td><input type="text" name="unit" class="w150" value="个" value="<?php echo $data['unit'];?>"></td>
			</tr>	
			<tr>
				<th class="w100">价格区间</th>
				<td><input type="text" name="pricerange" class="w150" value="3" value="<?php echo $data['pricerange'];?>"></td>
			</tr>		
			
		</table>
		<div id="showField"></div>
		<input type="submit" value="添加" name="submit" class="hd-success position-bottom" style="margin-left:30px;">
	</form>
	<script>
		validate:{
			$(function(){
				$('form').validate({
					cname:{
						rule:{
							required:true
						},
						error:{
							required:'栏目名不能为空'
						}
					}
					
				})
			})
		}
	</script>
</body>
</html>